package com.qijian.maindata.domain.query;

import com.baomidou.mybatisplus.annotation.TableName;
import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;


/**
 * 刀具台账对象 查询条件类
 *
 * @author qijian
 * @date 2024-02-29
 */

@Data
@ToString
@TableName("main_knife_ledger")
public class KnifeLedgerQuery {

    @WhereType(filed = "id")
    private Long id;
    @WhereType(filed = "id", type = WhereTypeEnum.IN)
    private Set<Long> ids;
    @WhereType(filed = "factory_area_id")
    private Long factoryAreaId;
    @WhereType(filed = "factory_area", type = WhereTypeEnum.LIKE)
    private String factoryArea;
    @WhereType(filed = "factory_area", type = WhereTypeEnum.LIKE)
    private String factoryAreaLike;
    @WhereType(filed = "location", type = WhereTypeEnum.LIKE)
    private String location;
    @WhereType(filed = "number", type = WhereTypeEnum.LIKE)
    private String number;

    @WhereType(filed = "number", type = WhereTypeEnum.EQ)
    private String numberNew;

    @WhereType(filed = "name", type = WhereTypeEnum.LIKE)
    private String name;

    @WhereType(filed = "name", type = WhereTypeEnum.EQ)
    private String nameNew;

    @WhereType(filed = "spec", type = WhereTypeEnum.EQ)
    private String spec;
    @WhereType(filed = "spec", type = WhereTypeEnum.LIKE)
    private String specLike;
    @WhereType(filed = "brand", type = WhereTypeEnum.LIKE)
    private String brand;

    @WhereType(filed = "brand", type = WhereTypeEnum.EQ)
    private String brandNew;
    @WhereType(filed = "quantity", type = WhereTypeEnum.LIKE)
    private BigDecimal quantity;
    @WhereType(filed = "unit")
    private String unit;
    @WhereType(filed = "producer")
    private String producer;
    @WhereType(filed = "batch_number")
    private String batchNumber;
    @WhereType(filed = "material_number")
    private String materialNumber;
    @WhereType(filed = "manufacture_code")
    private String manufactureCode;
    @WhereType(filed = "dept_id")
    private String deptId;
    @WhereType(filed = "dept_name", type = WhereTypeEnum.LIKE)
    private String deptName;

    private String remark;
    @WhereType(filed = "year")
    private String year;

    @WhereType(func = "(FIND_IN_SET({1},sys_classify.ancestors) or sys_classify.id = {1})")
    private Long itemClassifyId;

    @WhereType(filed = "location_parent", tableName = "main_ledger_area_detail")
    private String locationParent;

    @WhereType(filed = "area", tableName = "main_ledger_area_detail")
    private String area;

    @WhereType(filed = "location_type")
    private String locationType;

    @WhereType(filed = "type")
    private String type;

    @WhereType(filed = "code", tableName = "main_knife_ledger_detail", type = WhereTypeEnum.LIKE)
    private String code;


    @WhereType(filed = "factory_area", type = WhereTypeEnum.IN)
    private List<String> factoryAreas;

    @WhereType(func = "main_knife_ledger.location is null")
    private String noArea;
}
